import request from '@/utils/request'

export function departmentUserTree(data) {
  return request({
    url: '/api/v1/PermissionUser/DepartmentUserTree',
    method: 'get',
    params: data
  })
}

export function create(data) {
  return request({
    url: '/api/v1/SysBusinessDetectionItem/Create',
    method: 'post',
    data
  })
}

export function deleteRecord(data) {
  return request({
    url: '/api/v1/SysBusinessDetectionItem/Delete',
    method: 'delete',
    data
  })
}

export function update(data) {
  return request({
    url: '/api/v1/SysBusinessDetectionItem/Update',
    method: 'post',
    data
  })
}

export function getList(data, pagination) {
  if (pagination) {
    data["pageIndex"] = pagination.pageIndex;
    data["pageSize"] = pagination.pageSize;
  }
  return request({
    url: '/api/v1/SysBusinessDetectionItem/GetList',
    method: 'get',
    params: data
  })
}

// 查询检测项目不分页
export function GetDetectionItemNoPageList(data) {
  return request({
    url: '/api/v1/SysBusinessDetectionItem/GetDetectionItemNoPageList',
    method: "post",
    data: data
  })
}

// 查询检测项目不分页
export function GetSysBusinessDetectionItemsList(data) {
  return request({
    url: '/api/v1/SysBusinessDetectionItem/GetSysBusinessDetectionItemsList',
    method: "post",
    data: data
  })
}
// 查询检测项目不分页
export function GetSysBusinessDetectionItemGroupByNameList(data) {
  return request({
    url: '/api/v1/SysBusinessDetectionItem/GetSysBusinessDetectionItemGroupByNameList',
    method: "post",
    data: data
  })
}

export function GetDetectionProductStandard(data) {
  return request({
    url: '/api/v1/SysBusinessDetectionItem/GetDetectionProductStandard',
    method: "post",
    data: data
  })
}

export function getDetectionItemTree(data) {
  return request({
    url: '/api/v1/SysBusinessDetectionItem/GetTree',
    method: 'get',
    params: data
  })
}

// 查询单条检测项目
export const getDetectionItem = params => request('/api/v1/SysBusinessDetectionItem/Get', { params: params });

